package com.fzq.dao.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fzq.dao.po.RbacUser;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 */
@Mapper
public interface RbacUserMapper extends BaseMapper<RbacUser> {

    default RbacUser selectByUsername(String username){
        QueryWrapper<RbacUser> queryWrapper = new QueryWrapper<RbacUser>();
        queryWrapper.eq("username", username);
        return this.selectOne(queryWrapper);
    }

    default List<RbacUser> findAll(){
        return this.selectList(null);
    }

    default int add(RbacUser rbacUser){
        return  this.insert(rbacUser);
    }

    default RbacUser findById(Integer id){
        return this.selectById(id);
    }

    default int updateUser(RbacUser rbacUser){
        return this.updateById(rbacUser);
    }

    default int deleteUser(Integer id){
        return this.deleteById(id);
    }


}
